package com.eagle.posrole.dao.impl;

import java.util.List;

import com.eagle.commons.pub.IBATISDB;
import com.eagle.commons.vo.tbl_PosRole;
import com.eagle.posrole.dao.WRoleDao;
import com.ibatis.sqlmap.client.SqlMapClient;

public class WRoleDaoImpl implements WRoleDao {
	private SqlMapClient sqlMapClient;
	
	public Boolean addWRole(tbl_PosRole wrole) throws Exception {
		Boolean flag=false;
		if(sqlMapClient.insert(IBATISDB.creStmId("PosRole_Tbl_PosRole","addWRole"),wrole) !=null){
			flag=true;
		}
		return flag;
	}

	
	public Boolean delWRole(int RoleID) throws Exception {
		Boolean flag=false;
		if(sqlMapClient.delete(IBATISDB.creStmId("PosRole_Tbl_PosRole","delWRole"),RoleID) == 1){
			flag=true;
		}
		return flag;
	}
	public List<tbl_PosRole> getAllWRole() throws Exception {
		List<tbl_PosRole> resultList = null;
		resultList = sqlMapClient.queryForList(IBATISDB.creStmId("PosRole_Tbl_PosRole","getAllWRole"));
		return resultList;
	}
	
	public SqlMapClient getSqlMapClient() {
		return sqlMapClient;
	}

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}
}
